% 加载数据
clear;
load('D:\Program Files\DHRLS-master\dataset\gene_disease_Y.mat');
load('example.mat')
y = gene_disease_Y; % 每行序号代表疾病序号，每列序号代表基因序号
gamma = 0.5;
beta = 1;
lamda_1 = 1;
lamda_2 = 0.25;
iter_max = 10;
y_train = gene_disease_Y;
knn=50;


% 计算核矩阵
K1_list(:,:,1) = getCosKernel(y_train);
    K1_list(:,:,2) = getGipKernel(y_train, gamma);  % 疾病矩阵
    K1_list(:,:,3) = getJaccardKernel(y_train);
    K1_list(:,:,4) = getOushiKernel(y_train);
    K1_list(:,:,5) = getManhattanSimilarityKernel(y_train);



    K2_list(:,:,1) = getCosKernel(y_train');
    K2_list(:,:,2) = getGipKernel(y_train', gamma); % 基因矩阵
    K2_list(:,:,3) = getJaccardKernel(y_train');
    K2_list(:,:,4) = getOushiKernel(y_train');
    K2_list(:,:,5) = getManhattanSimilarityKernel(y_train');

% 分配权重
[weight_v1] = cka_kernels_weights(K1_list, y_train, 1);
[weight_v2] = cka_kernels_weights(K2_list, y_train, 2);

% 组合核矩阵
K_COM1 = combine_kernels(weight_v1, K1_list);	
K_COM2 = combine_kernels(weight_v2, K2_list);

% 使用DHRLS算法

[A_cos_com]  = DHRLS_1(K_COM1,K_COM2,y_train,beta,lamda_1,lamda_2,knn,proteinGeneMatrixNow,iter_max);
